<span class="close"><svg><use xlink:href="#shape-arrow-down"></use></svg></span>
{{#if layer}}
  <ul class="analysis-stats">
    {{#if totalArea}}
      <li>
        <span class="stats-title">Total selected area</span>
        <span class="stats-count"><strong>{{totalArea}}</strong> ha</span>
      </li>
    {{/if}}
    {{#if loss}}
      <li>
        <span class="stats-title">Loss <a href="#" class="source" data-source="how_to_adjust_date">{{lossDateRange}}</a><span class="stats-threshold" title="Click the gear icon located on the map to change the tree cover canopy density">with >{{threshold}}% <a href="#" class="canopy-button">canopy density</a></span></span>
        <span class="stats-count" style="color: {{layer.category_color}};"><strong>{{lossAlerts}}</strong> ha</span>
      </li>
      {{#if both}}
      <li>
        <span class="stats-title">Gain 2001-2012</span>
        <span class="stats-count" style="color: #6D6DE5;"><strong>{{gainAlerts}}</strong> ha</span>
      </li>
      {{/if}}
      <li>
        <span class="stats-title">Total extent<span class="stats-threshold" title="Click the gear icon located on the map to change the tree cover canopy density">with >{{threshold}}% <a href="#" class="canopy-button">canopy density</a></span></span>
        <span class="stats-count" style="color: #97bd3d;"><strong>{{extent}}</strong> ha</span>
      </li>
      {{#if warning_text}}
      <li>
        <div class="stats-notice">This algorithm approximates the results by sampling the selected area. Results are more accurate at closer zoom levels.</div>
      </li>
      {{/if}}
      <div id="toggleIFL" class="ifl-switch">
        <span class="label checked">Total area selected</span><span class="onoffswitch"><span></span></span><span class="label">Intact Forest Landscapes</span>
      </div>

    {{else}}
      {{#if forestgain}}
        <li>
          <span class="stats-title">Gain 2001-2012</span>
          <span class="stats-count" style="color: #6D6DE5;"><strong>{{gainAlerts}}</strong> ha</span>
        </li>
        <li>
          <span class="stats-title">Total extent<span class="stats-threshold" title="Click the gear icon located on the map to change the tree cover canopy density">with >{{threshold}}% <a href="#" class="canopy-button">canopy density</a></span></span>
          <span class="stats-count" style="color: #97bd3d;"><strong>{{extent}}</strong> ha</span>
        </li>
        {{#if warning_text}}
        <li>
          <div class="stats-notice">This algorithm approximates the results by sampling the selected area. Results are more accurate at closer zoom levels.</div>
        </li>
        {{/if}}
      {{else}}
        {{#if imazon}}
          <li>
            <span class="stats-title">Deforestation alerts ({{dateRange}})</span>
            <span class="stats-count" style="color: {{layer.title_color}};"><strong>{{defor}}</strong> ha</span>
          </li>
          <li>
            <span class="stats-title">Degradation alerts</span>
            <span class="stats-count" style="color: {{layer.category_color}};"><strong>{{degrad}}</strong> ha</span>
          </li>
        {{else}}
          {{#if prodes}}
            <li>
              <span class="stats-title">Prodes tree cover loss ({{dateRange}})</span>
              <span class="stats-count" style="color: {{layer.category_color}};"><strong>{{totalAlerts}}</strong> ha</span>
            </li>
            {{else}}
              {{#if guyra}}
              <li>
                <span class="stats-title">Grand Chaco tree cover loss:</span>
                <span class="stats-count" style="color: {{layer.category_color}};"><strong>{{totalAlerts}}</strong> ha</span>
              </li>
            {{else}}
              {{#if extent}}
                <li>
                  <span class="stats-title">Total extent<span class="stats-threshold" title="Click the gear icon located on the map to change the tree cover canopy density">with >{{threshold}}% <a href="#" class="canopy-button">canopy density</a></span></span>
                  <span class="stats-count" style="color: #97bd3d;"><strong>{{extent}}</strong> ha</span>
                </li>
                {{else}}
                <li>
                  <span class="stats-title">Total alerts ({{dateRange}})</span>
                  <span class="stats-count" style="color: {{layer.category_color}};"><strong>{{totalAlerts}}</strong> {{alertsName}}</span>
                </li>
              {{/if}}
            {{/if}}
          {{/if}}
        {{/if}} 
      {{/if}}
    {{/if}}
  </ul>
{{/if}}


<footer class="analysis-footer">
  <ul>
  {{#if downloadVisible}}
    <li>
      {{#if loss}}
        <a class="download-mobile-link" data-type="forest-change" href="http://earthenginepartners.appspot.com/science-2013-global-forest" target="_blank">
          <svg class="icon"><use xlink:href="#icon-analysis-download"></use></svg>
          <span class="tooltipmap bottom">Download data</span>
        </a>
      {{else}}
        {{#if forestgain}}
          <a class="download-mobile-link" data-type="forest-change" href="http://data.globalforestwatch.org/datasets/6c9f379a362e4926ad24b58444f4ba67" target="_blank">
            <svg class="icon"><use xlink:href="#icon-analysis-download"></use></svg>
            <span class="tooltipmap bottom">Download data</span>
          </a>
        {{else}}
          <div>
            <div class="dropdown-button">
              <svg class="icon"><use xlink:href="#icon-analysis-download"></use></svg>
            </div>
            <span class="tooltipmap bottom">Download and export data</span>
            <ul class="download-dropdown hidden">
              <li><a class="download-mobile-link" data-type="forest-change" href="{{download.svg}}" target="_blank">SVG</a></li>
              <li><a class="download-mobile-link" data-type="forest-change" href="{{download.geojson}}" target="_blank">GeoJSON</a></li>
              <li><a class="download-mobile-link" data-type="forest-change" href="{{download.shp}}" target="_blank">SHP</a></li>
              <li><a class="download-mobile-link" data-type="forest-change" href="{{download.kml}}" target="_blank">KML</a></li>
              <li><a class="download-mobile-link" data-type="forest-change" href="{{download.csv}}" target="_blank">CSV</a></li>
              <li><a class="download-mobile-link" data-type="forest-change" href="http://oneclick.cartodb.com/?file={{download.cdb}}&provider=gfw'" target="_blank">Open in Carto DB</a></li>
            </ul>
          </div>
        {{/if}}
      {{/if}}
    </li>
  {{/if}}
    <li id="analysis-delete">
      <svg class="icon"><use xlink:href="#icon-analysis-remove"></use></svg>
      <span class="tooltipmap bottom">Discard analysis</span>
    </li>
    <li id="analysis-subscribe">
      <svg class="icon"><use xlink:href="#icon-analysis-alerts"></use></svg>
      <span class="tooltipmap bottom">Subscribe</span>
    </li>
  </ul>
</footer>


{{!-- <footer class="analysis-footer">
  <ul>
    <li>
      <a href="{{url}}" target="_blank">
        <span class="tooltipmap bottom">Download data</span>
        <svg class="icon"><use xlink:href="#icon-analysis-download"></use></svg>
      </a>
    </li>
    <li id="analysis-delete"><span class="tooltipmap bottom">Discard analysis</span><svg class="icon"><use xlink:href="#icon-analysis-remove"></use></svg></li>
    <li id="analysis-subscribe"><span class="tooltipmap bottom">Subscribe</span><svg class="icon"><use xlink:href="#icon-analysis-alerts"></use></svg></li>
  </ul>
</footer> --}}
